<section class="content-header">
  <h1>
    授权应用
    <small>it all starts here</small>
  </h1>
  <ol class="breadcrumb">
    <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
    <li><a href="#">Examples</a></li>
    <li class="active">Blank page</li>
  </ol>
</section>

<!-- Main content -->
<section class="content">

  <!-- Default box -->
  <div class="box">
    <div class="box-header">
      <h3><%= t('.title', name: @application.name) %></h3>

    </div>
    <div class="box-body">

      <div class="row">
        <div class="col-md-8">
          <h4><%= t('.application_id') %>:</h4>

          <p><code id="application_id"><%= @application.uid %></code></p>

          <h4><%= t('.secret') %>:</h4>

          <p><code id="secret"><%= @application.secret %></code></p>

          <h4><%= t('.scopes') %>:</h4>

          <p><code id="scopes"><%= @application.scopes %></code></p>

          <h4><%= t('.callback_urls') %>:</h4>

          <table>
            <% @application.redirect_uri.split.each do |uri| %>
                <tr>
                  <td>
                    <code><%= uri %></code>
                  </td>
                  <td>
                    <%= link_to t('doorkeeper.applications.buttons.authorize'), oauth_authorization_path(client_id: @application.uid, redirect_uri: uri, response_type: 'code'), class: 'btn btn-success', target: '_blank' %>
                  </td>
                </tr>
            <% end %>
          </table>
        </div>

        <div class="col-md-4">
          <h3><%= t('.actions') %></h3>

          <p><%= link_to t('doorkeeper.applications.buttons.edit'), edit_oauth_application_path(@application), class: 'btn btn-primary' %></p>

          <p><%= render 'delete_form', application: @application, submit_btn_css: 'btn btn-danger' %></p>
        </div>
      </div>

    </div>
  </div>
  <!-- /.box -->

</section>
